<template>
	<jk-dialog
		v-model="showDialog"
		title="断纱排列"
		width="600px"
		append-to-body
		:show-close-btn="true"
		:show-confirm-btn="false"
		:show-cancel-btn="false"
		@on-close="onVisibleChange(false)"
		@on-visible-change="onVisibleChange"
	>
		<jk-table border :data="dataItem.breakPermutationList" :height="dialogTableHeight - 60">
			<vxe-column title="锭号" align="right" field="spindleNo" :width="100" />
			<vxe-column title="断头数" align="right" field="breakNum" :width="90" />
		</jk-table>
	</jk-dialog>
</template>

<script>
    import calHeight from '/src/mixins/cal-dialog-height';
    export default {
        props: {
            dialogState: {
                type: Boolean,
                default: false
            },
            dataItem: {
                type: Object,
                default() {
                    return {};
                }
            }
        },
        mixins: [calHeight],
        data() {
            return {
                showDialog: false,
                ruleForm: {}
            };
        },
        methods: {
            onVisibleChange(e) {
                this.$emit('on-visible-change', e);
                if (!e) {
                    Object.assign(this.$data, this.$options.data());
                }
            }
        },
        watch: {
            dialogState(newVal) {
                this.showDialog = newVal;
            }
        }
    };
</script>
